<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('农业信息机构建档拜访情况列表')"/>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <form class="form-horizontal" id="formDeptFiling">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <h3 style="margin-bottom: 5px; color: red; text-align: center">机构农业建档排名</h3>
            </div>
            <div class="btn-group-sm" id="toolbarDeptFiling" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()"
                   shiro:hasPermission="merchant:branchAgrFilingVisits:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table-deptFiling"></table>
            </div>
        </div>
    </form>
    <form class="form-horizontal" id="formIdDeptVisits">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <h3 style="margin-bottom: 5px; color: red; text-align: center">机构拜访次数排名</h3>
            </div>
            <div class="btn-group-sm" id="toolbarDeptVisits" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()"
                   shiro:hasPermission="merchant:branchAgrFilingVisits:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table-deptVisits"></table>
            </div>
        </div>
    </form>
    <form class="form-horizontal" id="formIdDeptDoTask">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <h3 style="margin-bottom: 5px; color: red; text-align: center">机构超时拜访次数排名</h3>
            </div>
            <div class="btn-group-sm" id="toolbarDeptDoTask" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()"
                   shiro:hasPermission="merchant:branchAgrFilingVisits:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table-deptDoTask"></table>
            </div>
        </div>
    </form>
    <form class="form-horizontal" id="formIdDeptUndoTask">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <h3 style="margin-bottom: 5px; color: red; text-align: center">机构超时未拜访次数排名</h3>
            </div>
            <div class="btn-group-sm" id="toolbarDeptUndoTask" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()"
                   shiro:hasPermission="merchant:branchAgrFilingVisits:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table-deptUndoTask"></table>
            </div>
        </div>
    </form>
</div>

<th:block th:include="include :: footer"/>
<script type="text/javascript">
    var prefix = ctx + "merchant/agricultureChart";

    $(function () {
        /*机构农业建档排名*/
        var deptFilingOptions = {
            id: 'bootstrap-table-deptFiling',
            toolbar: 'toolbarDeptFiling',
            formId: 'formDeptFiling',
            url: prefix + "/getAgrDeptFilingList",
            exportUrl: prefix + "/exportAgrDeptFilingList",
            modalName: "机构农业建档排名",
            columns: [
                {
                    field: 'deptName',
                    title: '机构名称'
                },
                {
                    field: 'rank',
                    title: '建档排名',
                    align: "center",
                },
                {
                    field: 'merchantNum',
                    title: '农业建档数',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'merchantLastMonthNum',
                    title: '上月新增',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'merchantThisMonthNum',
                    title: '本月新增',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'merchantCompareNum',
                    title: '较上月对比',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                }]
        };
        $.table.init(deptFilingOptions);
        /*机构拜访次数排名*/
        var deptVisitsOptions = {
            id: 'bootstrap-table-deptVisits',
            toolbar: 'toolbarDeptVisits',
            formId: 'formDeptVisits',
            url: prefix + "/getAgrDeptVisitsList",
            exportUrl: prefix + "/exportAgrDeptVisitsList",
            modalName: "机构拜访次数排名",
            columns: [
                {
                    field: 'deptName',
                    title: '机构名称'
                },
                {
                    field: 'rank',
                    title: '拜访排名',
                    align: "center",
                },
                {
                    field: 'visitNum',
                    title: '拜访次数',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'visitLastMouthNum',
                    title: '上月新增',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'visitThisMouthNum',
                    title: '本月新增',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'visitCompareNum',
                    title: '较上月对比',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                }]
        };
        $.table.init(deptVisitsOptions);
        /*机构超时拜访次数排名*/
        var deptDoTaskOptions = {
            id: 'bootstrap-table-deptDoTask',
            toolbar: 'toolbarDeptDoTask',
            formId: 'formIdDeptDoTask',
            url: prefix + "/getAgrDeptDoTaskList",
            exportUrl: prefix + "/exportAgrDeptDoTaskList",
            modalName: "机构超时拜访次数排名",
            columns: [
                {
                    field: 'deptName',
                    title: '机构名称'
                },
                {
                    field: 'rank',
                    title: '超时拜访排名',
                    align: "center",
                },
                {
                    field: 'doTaskSum',
                    title: '超时拜访数',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'percentageDoTask',
                    title: '超时拜访率',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value) + '%';
                    }
                },
                {
                    field: 'rankPercentage',
                    title: '超时拜访率排名',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                }]
        };
        $.table.init(deptDoTaskOptions);
        /*机构超时未拜访次数排名*/
        var deptUndoTaskOptions = {
            id: 'bootstrap-table-deptUndoTask',
            toolbar: 'toolbarDeptUndoTask',
            formId: 'formIdDeptUndoTask',
            url: prefix + "/getAgrDeptUnDoTaskList",
            exportUrl: prefix + "/exportAgrDeptUnDoTaskList",
            modalName: "机构超时未拜访次数排名",
            columns: [
                {
                    field: 'deptName',
                    title: '机构名称'
                },
                {
                    field: 'rank',
                    title: '超时未拜访排名',
                    align: "center",
                },
                {
                    field: 'undoTaskSum',
                    title: '超时未拜访数量',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'percentageUndoTask',
                    title: '超时未拜访率',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value) + '%';
                    }
                },
                {
                    field: 'rankPercentage',
                    title: '超时未拜访率排名',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                }]
        };
        $.table.init(deptUndoTaskOptions);
    })
</script>
</body>
</html>